#include <iostream>
using namespace std;

class C
{
public:
    C() { cout << "C::C()" << endl; }
    ~C() { cout << "C::~C()" << endl; }
};

class B
{
public:
    B() { cout << "B::B()" << endl; }
    virtual ~B() { cout << "B::~B()" << endl; }
};
class D : public B
{
public:
    D() { cout << "D::D()" << endl; }
    ~D() { cout << "D::~D()" << endl; }

private:
    C c;
};

int main()
{
    B *b = new D;
    delete b;
    return 0;
}